import request from '@/utils/request'
import da from 'element-ui/src/locale/lang/da'

// 查询业务接口管理列表
export function listInterface(query) {
  return request({
    url: '/business/interface/list',
    method: 'get',
    params: query
  })
}

export function getAllInterface(params) {
  let u = params?'/business/interface/allInterface/?frontIds='+params :'/business/interface/allInterface'
  return request({
    url: u,
    method: 'get',
  })
}

export function getFrontInterfaces() {
  return request({
    url: '/business/interface/frontInterfaces',
    method: 'get',
  })
}

// 查询业务接口管理详细
export function getInterface(id) {
  return request({
    url: '/business/interface/' + id,
    method: 'get'
  })
}

// 新增业务接口管理
export function addInterface(data) {
  return request({
    url: '/business/interface/saveInterface',
    method: 'post',
    data: data
  })
}

// 修改业务接口管理
export function updateInterface(data) {
  return request({
    url: '/business/interface',
    method: 'put',
    data: data
  })
}

// 删除业务接口管理
export function delInterface(id) {
  return request({
    url: '/business/interface/delete/' + id,
    method: 'delete'
  })
}
// 删除业务接口管理
export function previewInfo(data) {
  return request({
    url: '/business/interface/previewSql',
    method: 'post',
    data:data
  })
}

